<div class="top">
    <div class="info">
        <div class="help">/<a href="/" id="loginFlag">登录</a>/<a href="/index.php/Passport/signup">注册</a>/<a href="#">帮助中心</a>/
        </div>
    </div>
</div>
<script type="text/javascript">
    function readcookie(objName) {
        var arrStr = document.cookie.split("; ");
        for (var i = 0; i < arrStr.length; i ++) {
            var temp = arrStr[i].split("=");
            if (temp[0] == objName) {
                return unescape(temp[1]);
            }
        }
    }
    <?php
    if (!array_key_exists("isLogOut", $view)) {
        ?>
    $(function() {
        login = readcookie("baoNa_isLogin");
        if (login == "yes") {
            $.get("/index.php/ajax/isLogin", function(data) {
                if (data == "1") {
                    $("#loginFlag").text("退出");
                    $("#loginFlag").attr("href", "/index.php/Passport/signout");
                    $.get("/index.php/ajax/currentUser", function(data) {
                        data = eval("(" + data + ")");
                        $("#loginForm").html("<div class='t'><p style='color:white'>当前登录用户:" + data.userName + "(" + data.realName + ")</p></div><div class='t'><p style='color:white'>上次登录时间:" + data.lastLoginDate + "</p></div><div class='t'><p><a style='color:white' href='/index.php/Passport/signout'>退出登录</a></p></div>")
                    })

                }
            })
        }
    })
        <?php }?>
</script>